package com.matt.foundation.constant;

import lombok.Setter;

public enum AuditConstant{
        OPEN(0, "开启"),
        CLOSE(1, "关闭");

        @Setter
        private int code;

        @Setter
        private String value;

        AuditConstant(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public AuditConstant get(int code){
            for (AuditConstant audit : values()) {
                if (audit.codeOf()==code)
                    return audit;
            }
            return null;
        }
    }